package com.example.aircraft.prop;


import com.example.aircraft.aircraft.HeroAircraft;

public class Prop_Bullet extends AbstractProp {
    private BarageManager barageManager = new BarageManager();
    public Prop_Bullet(int locationX, int locationY, int speedY){
        super(locationX, locationY,0, speedY);
    }
    @Override
    public void activate(){
        super.activate();
        if(!HeroAircraft.newInstance().notValid()){
        HeroAircraft.newInstance().clusterDeploy();}
        barageManager.start();
    }
}
class BarageManager extends Thread{
    private Thread t;
    @Override
    public void run() {
        try {
            sleep(10000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        HeroAircraft.newInstance().straightDeploy();
    }
    @Override
    public void start(){
        if (t == null) {
            t = new Thread (this, "HeroBarrageManager");
            t.start ();
        }
    }

}
